package com.ithaixiang.demo.controller;

import com.ithaixiang.demo.mapper.ExcelMapper;
import com.ithaixiang.demo.service.ExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RequestMapping("/index")
@RestController
public class ExcelController {
    @Autowired
    private ExcelMapper excelMapper;

    @Autowired
    ExcelService excelService;
    @PostMapping("/upload")
    public String unFile(MultipartFile file) throws IOException{
        if (file==null){
            return "参数不能为空";
        }
    return excelService.getData(file);
    }


}